#ifndef _BUOLA_CHART_CAXIS_H_
#define _BUOLA_CHART_CAXIS_H_

#include <buola/chart/cmapping.h>

namespace buola { namespace chart {

class CAxis
{
public:
    CAxis();
    virtual ~CAxis();
    
public:
///\name setting properties
//@{
    void SetMapping(CMapping *pMapping);
    void SetLimits(double pMin,double pMax);
    void SetAutoScale(bool pAuto=true);
    void SetTitle(const std::wstring &pTitle);
    //!sets a list of strings to be used as labels (useful with bar plots)
    virtual void SetLabelNames(const std::vector<std::wstring> &pNames);
    void SetMark(double pPos);
    void RemoveMark();
//@}

///\name getting properties
//@{
    const std::wstring &Title()      {   return mTitle;  }
    virtual bool CanZoom()          {   return false;   }
//@}

////////////////////////////
//! \name drawing process
//@{
    ///maps from chart coordinates to screen coordinates
    double Map(double pX)           {   return mMapping->Map(pX);        }
    double InverseMap(double pX)    {   return mMapping->InverseMap(pX); }
//@}

protected:
    bool mAutoScale;

    std::wstring mTitle;

    std::vector<std::wstring> mLabelNames;

    struct
    {
        bool mEnabled;
        double mPos;
    } mMark;

    CMapping *mMapping;
};

/*namespace chart*/ } /*namespace buola*/ }

#endif
